<template>
    <div>
      <div ref="bpmn-canvas">
    </div>
</div>
  </template>
  
  <script>
  import BpmnModeler from "bpmn-js/lib/Modeler";
  // 自定义左侧菜单（修改 默认任务 为 用户任务）
//   import CustomPaletteProvider from "../package/process-designer/plugins/palette";
  // 自定义渲染
//   import CustomRenderer from "../package/process-designer/plugins/render";
  // 自定义元素选中时的弹出菜单（修改 默认任务 为 用户任务）
//   import CustomContextPadProvider from "../package/process-designer/plugins/context-pad";
  export default {
    data() {
      return {
        bpmnModeler: null,
      };
    },
    mounted() {
      this.initBpmnModeler();
    },
    methods: {
      initBpmnModeler() {
        if (this.bpmnModeler) return;
        this.bpmnModeler = new BpmnModeler({
          container: this.$refs.bpmn - canvas,
          additionalModules: [
            CustomPaletteProvider,
            CustomRenderer,
            CustomContextPadProvider,
          ], //添加自定义模块
        });
      },
    },
  };
  </script>
  